A short description of the post.
Importing shapefile using st_read() of sf package. The output object is in tibble sf object class.
Reading layer `MP14_SUBZONE_WEB_PL' from data source
`C:\kwekyichen\IS415_blog\_posts\2021-09-13-in-class-exercise-5\data\shapefile'
using driver `ESRI Shapefile'
Simple feature collection with 323 features and 15 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 2667.538 ymin: 15748.72 xmax: 56396.44 ymax: 50256.33
Projected CRS: SVY21
Projection is in svy21.
read_rds() of readr package is used instead of readRDS() of base R. Ouput of read_rds() is in tibble object.
Note that there are some data issue in childcare data frame because Lat and Lng should be in numeric data type. The coordinate fields seems to be in decimal degree. Hence, wgs referencing system is assumed.
Note: st_as_sf() accept coordinates in character data type
alpha sets transparency.
as_Spatial() of sf package
chas: spatialpointsdf chilcare: spatialpointsdf mpsz: spatialpolygondf
as.SpatialPoint() or as.SpatialPolygon() of maptools package
using as.ppp() of maptools package
rjitter() of spatstat function
[1] FALSE
[1] FALSE
tmap dont understand ppp…
, is necessary to complete syntax
owin() of spatstat. need owin to define study area

Generating 99 simulations of CSR ...
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
Done.
Generating 99 simulations of CSR ...
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99.
Done.